﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DiscoveryLogic.DataViz.NetworkDiagram.NetworkData
{
    /// <summary>
    /// determine if the member can be expanded/linked to other graph
    /// using pk-fk relations, this provide hard link between different 
    /// node types
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class Linkable:Attribute
    {
        private bool _CanLink;
        /// <summary></summary>
        public bool CanLink
        {
            get
            {
                return this._CanLink;
            }
            set
            {
                this._CanLink = value;
            }
        }

        private LinkMethod _Method;
        /// <summary></summary>
        public LinkMethod Method
        {
            get
            {
                return this._Method;
            }
            set
            {
                this._Method = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="canLink"></param>
        public Linkable(bool canLink)
        {
            this._CanLink = canLink;
            this._Method = LinkMethod.Equals;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="canLink"></param>
        /// <param name="method"></param>
        public Linkable(bool canLink, LinkMethod method)
        {
            this._CanLink = canLink;
            this._Method = method;
        }
    }
}
